package org.jeecg.modules.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import java.util.Map;
import java.util.Objects;

@Data
@TableName("biz_site")
public class BizSiteEntity {

    @TableId(type = IdType.ASSIGN_ID)
    @Id
    @Column(name = "site_id", nullable = false)
    @ApiModelProperty(value = "主键ID")
    private String siteId;
    @Basic
    @Column(name = "site_code", nullable = false, length = 32)
    @ApiModelProperty(value = "站点编号 唯一依据")
    private String siteCode;
    @Basic
    @Column(name = "site_desc", nullable = false, length = 128)
    @ApiModelProperty(value = "站点详情")
    private String siteDesc;
    @Basic
    @Column(name = "province_code", nullable = true)
    @ApiModelProperty(value = "所属省代码")
    private String provinceCode;
    @Basic
    @Column(name = "city_code", nullable = true)
    @ApiModelProperty(value = "所属市代码")
    private String cityCode;

    @Basic
    @Column(name = "district_code", nullable = true)
    @ApiModelProperty(value = "所属县代码")
    private String districtCode;

    @Basic
    @Column(name = "longitude", nullable = true, precision = 10)
    @ApiModelProperty(value = "中心点经度 从高德地图接口获取")
    private BigDecimal longitude;
    @Basic
    @Column(name = "latitude", nullable = true, precision = 10)
    @ApiModelProperty(value = "中心点纬度 从高德地图接口获取")
    private BigDecimal latitude;
    @Basic
    @Column(name = "creator_id", nullable = false)
    @ApiModelProperty(value = "创建人ID 取登录信息")
    private Object creatorId;
    @Basic
    @Column(name = "create_time", nullable = false)
    @ApiModelProperty(value = "创建时间，取传入时间")
    private Timestamp createTime;
    @Basic
    @Column(name = "modifier_id", nullable = false)
    @ApiModelProperty(value = "修改人ID，取登录信息")
    private Object modifierId;
    @Basic
    @Column(name = "modify_time", nullable = false)
    @ApiModelProperty(value = "修改时间 自动更新")
    private Timestamp modifyTime;
    @Basic
    @Column(name = "status", nullable = false)
    @ApiModelProperty(value = "逻辑删除标识 1是未删除，0是已删除")
    @Dict(dicCode = "dict_item_status")
    private Object status;

    @Basic
    @Column(name = "p_site_id", nullable = false)
    @Dict(dictTable ="biz_site",dicText = "site_desc",dicCode = "site_id")
    @ApiModelProperty(value = "父键ID")
    private String pSiteId;

    @TableField(exist = false)
    private List<Map<?,?>> siteUserList;

    public String getSiteId() {
        return siteId;
    }

    public void setSiteId(String siteId) {
        this.siteId = siteId;
    }

    public String getSiteCode() {
        return siteCode;
    }

    public void setSiteCode(String siteCode) {
        this.siteCode = siteCode;
    }

    public String getSiteDesc() {
        return siteDesc;
    }

    public void setSiteDesc(String siteDesc) {
        this.siteDesc = siteDesc;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public BigDecimal getLongitude() {
        return longitude;
    }

    public void setLongitude(BigDecimal longitude) {
        this.longitude = longitude;
    }

    public BigDecimal getLatitude() {
        return latitude;
    }

    public void setLatitude(BigDecimal latitude) {
        this.latitude = latitude;
    }

    public Object getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(Object creatorId) {
        this.creatorId = creatorId;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Object getModifierId() {
        return modifierId;
    }

    public void setModifierId(Object modifierId) {
        this.modifierId = modifierId;
    }

    public Timestamp getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Timestamp modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Object getStatus() {
        return status;
    }

    public void setStatus(Object status) {
        this.status = status;
    }

    public String getDistrictCode() {
        return districtCode;
    }

    public void setDistrictCode(String districtCode) {
        this.districtCode = districtCode;
    }

    public List<Map<?,?>> getSiteUserList() {
        return siteUserList;
    }

    public void setSiteUserList(List<Map<?,?>> siteUserList) {
        this.siteUserList = siteUserList;
    }

    public String getpSiteId() {
        return pSiteId;
    }

    public void setpSiteId(String pSiteId) {
        this.pSiteId = pSiteId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BizSiteEntity that = (BizSiteEntity) o;
        return Objects.equals(siteId, that.siteId) && Objects.equals(siteCode, that.siteCode) && Objects.equals(siteDesc, that.siteDesc) && Objects.equals(provinceCode, that.provinceCode) && Objects.equals(cityCode, that.cityCode) && Objects.equals(districtCode, that.districtCode) && Objects.equals(longitude, that.longitude) && Objects.equals(latitude, that.latitude) && Objects.equals(creatorId, that.creatorId) && Objects.equals(createTime, that.createTime) && Objects.equals(modifierId, that.modifierId) && Objects.equals(modifyTime, that.modifyTime) && Objects.equals(status, that.status) && Objects.equals(pSiteId, that.pSiteId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(siteId, siteCode, siteDesc, provinceCode, cityCode, districtCode, longitude, latitude, creatorId, createTime, modifierId, modifyTime, status, pSiteId);
    }
}
